<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMemberFlowsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('member_flows', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('member_id')->comment('会员ID');
            $table->tinyInteger('type')->comment('1 支出 2 收入');
            $table->string('desc')->comment('业务描述');
            $table->decimal('amount', 10,2)->comment('交易金额');
            $table->decimal('amount_balance', 10 ,2)->comment('本次余额');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('member_flows');
    }
}
